﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SelectCust.aspx.cs" Inherits="Skyworth.CRM.Web.SalesManagement.SelectCust" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>选择客户</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <link href="../themes/default/style.css" rel="stylesheet" type="text/css" />
    <link href="../themes/css/core.css" rel="stylesheet" type="text/css" />
    <link href="../themes/css/pages.css" rel="stylesheet" type="text/css" />
    <link href="../themes/css/wbox.css" rel="stylesheet" type="text/css" />
    <link href="../themes/css/Messagebox.css" rel="stylesheet" type="text/css" />

    <script src="../javascripts/jquery-1.4.4.min.js" type="text/javascript"></script>

    <script src="../javascripts/dwz.core.js" type="text/javascript"></script>

    <script src="../javascripts/MessageBox.js" type="text/javascript"></script>

    <script src="../javascripts/dwz.pagination.js" type="text/javascript"></script>

    <script src="../javascripts/wbox.js" type="text/javascript"></script>

    <style>
        .GridViewHeaderStyle th
        {
            background: url("../themes/default/images/grid/tableth.png") repeat-x scroll 0 0 #F0EFF0;
            padding: 2px;
            line-height: 21px;
            border-right: solid 1px #D0D0D0;
            border-bottom: solid 1px #D0D0D0;
            font-weight: bolder;
            height: 21px;
            width: auto;
            border-bottom: solid 1px #ededed;
            background-color: #F7F6F3;
            cursor: pointer;
            color: #333333;
            padding: 1px 2px;
            line-height: 21px;
            border-right: solid 1px #ededed;
        }
        .GridViewHeaderStyle
        {
            background: url("../themes/default/images/grid/tableth.png") repeat-x scroll 0 0 #F0EFF0;
            padding: 2px;
            line-height: 21px;
            border-right: solid 1px #D0D0D0;
            border-bottom: solid 1px #D0D0D0;
            font-weight: bolder;
            height: 21px;
            width: auto;
            border-bottom: solid 1px #ededed;
            background-color: #F7F6F3;
            cursor: pointer;
            color: #333333;
            padding: 1px 2px;
            line-height: 21px;
            border-right: solid 1px #ededed;
        }
        .GridViewRowStyle
        {
            background: url("../themes/default/images/grid/tableth.png") repeat-x scroll 0 0 #F0EFF0;
            padding: 2px;
            line-height: 21px;
            border-right: solid 1px #D0D0D0;
            border-bottom: solid 1px #D0D0D0;
            font-weight: bolder;
            height: 21px;
            width: auto;
            border-bottom: solid 1px #ededed;
            background-color: #F7F6F3;
            cursor: pointer;
            color: #333333;
            padding: 1px 2px;
            line-height: 21px;
            border-right: solid 1px #ededed;
        }
        .GridViewRowStyle td, .GridViewAlternatingRowStyle
        {
            border-right: solid 1px #ededed;
            overflow: hidden;
            padding: 0 3px;
            border-bottom: solid 1px #ededed;
            vertical-align: middle;
            line-height: 23px;
        }
        .GridViewSelectedRowStyle
        {
            background-color: #7cc5e5;
            border-color: #b8d0d6;
        }
    </style>

    <script type="text/javascript">

        $("#btnClose").click(function() {
            parent.addWindow.close();
        })

        $(document).ready(function() {
            // $("input[type=text],textarea").addClass("textInput").width(180).focus(function() { $(this).addClass("focus"); }).blur(function() { $(this).removeClass("focus") });
            $("#btnClose").click(function() {
                parent.addWindow.close();
            })
            //                        $("#btnSave").click(function() {
            //                            return SaveCheck();
            //                        })

        })




        function AddRemoveValues(oChk) {
            var selectedValue = $("#HdnSelectedValues").val();
            if (oChk.checked) {
                selectedValue += "," + oChk.value;
                $("#HdnSelectedValues").val(selectedValue);
            }
            else
                $("#HdnSelectedValues").val(selectedValue.replace("," + oChk.value, ""));
        }

        function SaveCheck() {

            if ($("#HdnSelectedValues").val() == "" || $("#HdnSelectedValues").val() == ",") {
                alert("请选择客户！");
                return false;
            }
        }
        
        

    </script>

</head>
<body style="background-color: White; overflow:auto">
    <form id="SelectMultiPage" runat="server">
    <div>
        <table width="100%">
            <tr>
                <td>
                    <div class="">
                        <div class="panel">
                            <div class="panelHeaderContent">
                                <h1>
                                    客户信息</h1>
                            </div>
                        </div>
                        <div class="">
                            <ul>
                                <li style="float: left;"><span>客户编码：</span>
                                    <asp:TextBox ID="txtCustomerCode" runat="server"></asp:TextBox>
                                </li>
                                <li style="float: left; padding-left: 10px;"><span>客户名称：</span>
                                    <asp:TextBox ID="txtCustomerName" runat="server"></asp:TextBox>
                                </li>
                                <li style="float: left; padding-left: 20px">
                                    <div class="buttonActive">
                                        <div class="buttonContent">
                                            <asp:Button ID="btnSearch" runat="server" Text="查询" ToolTip="查询客户信息" CssClass="serverButton"
                                                OnClick="btnSearch_Click" />
                                        </div>
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="tableList">
                        <table class="list" width="100%">
                            <tr>
                                <td>
                                    <asp:DataGrid ID="DataGrid1" HorizontalAlign="Center" AutoGenerateColumns="False"
                                        Width="100%" runat="server" AllowPaging="true" PageSize="10" PagerStyle-HorizontalAlign="Right"
                                        PagerStyle-Mode="NumericPages" OnItemDataBound="DataGrid1_ItemDataBound" OnPageIndexChanged="DataGrid1_PageIndexChanged"
                                        GridLines="None">
                                        <HeaderStyle CssClass="GridViewHeaderStyle" />
                                        <SelectedItemStyle CssClass="GridViewSelectedRowStyle" />
                                        <PagerStyle Visible="True" Font-Size="9pt" Mode="NumericPages"></PagerStyle>
                                        <Columns>
                                            <asp:TemplateColumn HeaderText="选择">
                                                <ItemTemplate>
                                                    <input type="checkbox" runat="server" id="chkSelect" onclick="AddRemoveValues(this)"
                                                        value='<%#DataBinder.Eval(Container.DataItem,"FItemId")%>' />
                                                </ItemTemplate>
                                            </asp:TemplateColumn>
                                            <asp:TemplateColumn HeaderText="客户ID">
                                                <ItemTemplate>
                                                    <asp:Literal Text='<%# DataBinder.Eval(Container.DataItem, "FItemId") %>' runat="server"
                                                        ID="TitleShow" />
                                                </ItemTemplate>
                                            </asp:TemplateColumn>
                                            <asp:BoundColumn DataField="FNumber" HeaderText="客户编码"></asp:BoundColumn>
                                            <asp:BoundColumn DataField="FName" HeaderText="客户名称"></asp:BoundColumn>
                                            <asp:BoundColumn DataField="FDree" HeaderText="详细地址"></asp:BoundColumn>
                                            <asp:BoundColumn DataField="FMobil" HeaderText="手机号"></asp:BoundColumn>
                                        </Columns>
                                    </asp:DataGrid>
                                </td>
                            </tr>
                            <tr>
                                <td class="readOnly" style="padding-right: 12px; background: url('../themes/default/images/grid/grid.png') repeat scroll 0 0">
                                    <a title="清空" href="javascript:void(0);" class="button" style="float: left" id="btnClose">
                                        <span>关闭</span></a>
                                    <div class="button" style="float: right; margin-right: 5px;">
                                        <div class="buttonContent">
                                            <asp:Button ID="btnSave" runat="server" Text="保存" CssClass="serverButton" OnClick="btnSave_Click"
                                                OnClientClick="return SaveCheck();" />
                                        </div>
                                    </div>
                                    <div style="clear: both; float: none; display: none;">
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div class="panelFooter">
                        <div class="panelFooterContent">
                            <input id="HdnSelectedValues" type="hidden" name="HdnSelectedValues" runat="server" />
                        </div>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
